package com.bocai.freeman.view.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bocai.freeman.R;
import com.bocai.freeman.base.BaseActivity;
import com.bocai.freeman.utils.ToolbarHelper;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by admin on 2016/5/19.
 */
public class MyWalletActivity extends BaseActivity {

    @Bind(R.id.title)
    TextView mTitle;
    @Bind(R.id.app_bar_layout)
    AppBarLayout mAppBarLayout;
    @Bind(R.id.rl_my_balance)
    RelativeLayout mRlMyBalance;
    @Bind(R.id.rl_my_member)
    RelativeLayout mRlMyMember;
    @Bind(R.id.rl_my_integral)
    RelativeLayout mRlMyIntegral;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_wallet);
        ButterKnife.bind(this);
        initEvent();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        ToolbarHelper.setup(this,R.string.my_wallet,R.mipmap.left_return);
        click(mRlMyBalance).subscribe(o -> startActivity(new Intent(this,MyBalanceActivity.class)));
        click(mRlMyMember).subscribe(o -> {
            // TODO: 2016/5/19 先判断是不是会员
            startActivity(new Intent(MyWalletActivity.this,MyMemberActivity.class));
        });
        click(mRlMyIntegral).subscribe(o -> startActivity(new Intent(MyWalletActivity.this,MyIntegralActivity.class)));
    }

    @Override
    public void setData(Object obj) {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}
